
export const ADD_TO_CART = 'ADD_TO_CART';

export function addToCart(product, quantity, unitCost){
    return {
      type : ADD_TO_CART, 
      payload : {product, quantity, unitCost}
    }
  }

export function addToCartAsync(product, quantity, unitCost){
  setTimeout(function(){
   addToCart(product, quantity, unitCost)
  })
}  
export const UPDATE_CART = 'UPDATE_CART'

export function updateCart(product, quantity, unitCost){
  return {
    type: UPDATE_CART,
    payload: {product, quantity, unitCost}
  }
}

export const DELET_FROM_CART = 'DELET_FROM_CART'

export function deleteFromCart(product, quantity, unitCost){
  return {
    type: DELET_FROM_CART,
    payload : {
      product
    }
  }
}